import request from '@/utils/request'

// 查询企业的部门列表
export function getDepartmentsApi() {
  return request({
    url: '/company/department'
  })
}
/**
 * 根据ID删除部门
 */
export function delDepartmentByIdApi(id) {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}
/**
 * 新增部门
 */
export function addDepartment(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}
/**
 * 根据部门Id查询部门详情
 */
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
/**
 * 封装编辑部门接口
 */
export function updateDepart(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
